package com.sunny.ynhz.ui.mine;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.sunny.ynhz.R;
import com.sunny.ynhz.adapter.mine.MysignedAdapater;
import com.sunny.ynhz.ui.base.BaseFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by Administrator on 2017/7/15/015.
 */

public class MySignedFragment extends BaseFragment {
    @BindView(R.id.rl_data)
    RecyclerView rl_data;
    List<String> mlist = new ArrayList<>();
    private MysignedAdapater mysignedAdapater;
    private GridLayoutManager gridLayoutManager;
    public static MySignedFragment getinstanceMysignedFragment(){
        return  new MySignedFragment();
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.inclule_signed_my;
    }

    @Override
    protected void init() {
        super.init();

    }

    @Override
    protected void setUpView() {
        super.setUpView();
        gridLayoutManager = new GridLayoutManager(getActivity(), 7) {
            @Override
            public boolean canScrollVertically() {
                return false;
            }
        };
        gridLayoutManager.setOrientation(GridLayoutManager.VERTICAL);
        rl_data.setLayoutManager(gridLayoutManager);
        initData();
        mysignedAdapater = new MysignedAdapater(getActivity(), mlist);
        rl_data.setAdapter(mysignedAdapater);
    }

    public void initData() {
        for (int i = 0; i < 31; i++) {
            mlist.add((i + 1) + "");
        }
    }
}
